//+-----------------------------------------------------------------------------
//| Included files
//+-----------------------------------------------------------------------------
#include "Common.h"


//+-----------------------------------------------------------------------------
//| Global objects
//+-----------------------------------------------------------------------------
COMMON Common;


//+-----------------------------------------------------------------------------
//| Constructor
//+-----------------------------------------------------------------------------
COMMON::COMMON()
{

}


//+-----------------------------------------------------------------------------
//| Destructor
//+-----------------------------------------------------------------------------
COMMON::~COMMON()
{

}


//+-----------------------------------------------------------------------------
//| Turns the string into all lowercase characters
//+-----------------------------------------------------------------------------
std::string COMMON::LowerCase(CONST std::string& String) CONST
{
	std::string Result = String;

	for (INT i=0; i<static_cast<INT>(Result.size()); i++)
	{
		Result[i] = std::tolower(Result[i]);
	}

	return Result;
}


//+-----------------------------------------------------------------------------
//| Returns the extention of a filename
//+-----------------------------------------------------------------------------
std::string COMMON::GetExtention(CONST std::string& FileName) CONST
{
	INT i;

	i = static_cast<INT>(FileName.rfind("."));
	if (i == std::string::npos) return "";

	return FileName.substr(i + 1, FileName.size() - i - 1);
}